﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using AbstraX.Bindings.Interfaces;

namespace SolutionFramework.Web
{
    public class BindingsTreeCache : IBindingsTreeCache
    {
        private Dictionary<string, IBindingsTreeCachedTree> cachedTrees;

        public Dictionary<string, IBindingsTreeCachedTree> CachedTrees
        {
            get 
            {
                if (cachedTrees == null)
                {
                    cachedTrees = new Dictionary<string, IBindingsTreeCachedTree>();
                }

                return cachedTrees;
            }
        }
         
        public void ResetCache()
        {
            if (cachedTrees != null)
            {
                cachedTrees.Clear();
                cachedTrees = null;
            }
        }
    }
}